/**
 * @(#)RecursosFinancierosDAOFactory.java Mar 15, 2007
 *
 * Copyright (c) 2005-2010 Psiqueware S.A. de C.V. All Rights Reserved.
 * This software is the proprietary information Psiqueware S.A. de C.V.
 * Use is subject to license terms.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *
 * <br/>Usuario : Psique
 * <br/>Creaci&oacute;n: Mar 15, 2007 - 7:55:18 PM
 * <br/>
 * <br/>
 * <br/><t5>Cambios :</t5>
 * <br/><b>Fecha | Autor  |  Cambios</b>
 * <ul>
 * <li>Mar 15, 2007 | <a href = "mailto:AngelElectrico@PsiqueWare.com">Psique</a> | Creaci&oacute;n del Objeto.</li>
 *
 * </ul>
 */

package com.psiqueware.jazmin.empresas.recursos.financieros.dao;

import com.psiqueware.alheli.dao.BaseDAOFactory;
import com.psiqueware.alheli.dao.TipoDAO;
import com.psiqueware.alheli.logging.Logger;
import com.psiqueware.alheli.logging.LoggerFactory;
import com.psiqueware.jazmin.empresas.recursos.financieros.dao.fake.CentroCostosDAOFake;
import com.psiqueware.jazmin.empresas.recursos.financieros.dao.hbm.CentroCostosDAOHbmA;

/**
 * Fabrica de DAOs de RecursosFinancieros.
 * <br/>Paquete Original: com.psiqueware.laVIE.empresas.recursos.financieros.dao
 * <br/>Nombre  Original: RecursosFinancierosDAOFactory
 * <br/>Oprima para ver : <a href="RecursosFinancierosDAOFactory.java.html"><i>C&oacute;digo Fuente</i> </a>
 *
 * @author <a href="mailto:AngelElectrico@PsiqueWare.com">Psique</a>
 * @version Revision: 1.1 Mar 15, 2007 7:55:18 PM
 */
public class RecursosFinancierosDAOFactory extends BaseDAOFactory
{

    /** Logger de clase para RecursosFinancierosDAOFactory */
    private static final Logger s_log = LoggerFactory.getLogger ( RecursosFinancierosDAOFactory.class );


    /** Constructor de RecursosFinancierosDAOFactory. */
    public RecursosFinancierosDAOFactory ()
    {
    }

    /** Objeto de operaciones CRUD para CentroCostos. */
    private static CentroCostosDAO s_daoCentroCostos;


    /**
     * Devuelve una instancia del dao para CentroCostos.
     *
     * @return CentroCostosDAO para operaciones CRUD.
     */
    public static synchronized CentroCostosDAO findDAOCentroCostos ()
    {
        if ( s_daoCentroCostos == null )
        {
            if ( m_tipo.equals ( TipoDAO.FAKE ) )
            {
                s_daoCentroCostos = new CentroCostosDAOFake ();
            }
            else if ( m_tipo.equals ( TipoDAO.DUMMY ) )
            {
                //s_daoCentroCostos = new CentroCostosDAODummy ();
            }
            else if ( m_tipo.equals ( TipoDAO.HIBERNATE_ANNOTATIONS ) )
            {
                s_daoCentroCostos = new CentroCostosDAOHbmA ();
            }
            else if ( m_tipo.equals ( TipoDAO.HIBERNATE_CLASICO ) )
            {
                //s_daoCentroCostos = new CentroCostosDAOHbmC ();
            }
            else if ( m_tipo.equals ( TipoDAO.ORACLE ) )
            {
                //s_daoCentroCostos = new CentroCostosDAOOracle ();
            }
            else if ( m_tipo.equals ( TipoDAO.DERBY ) )
            {
                //s_daoCentroCostos = new CentroCostosDAODerby ();
            }

            if ( s_daoCentroCostos == null )
            {
                String error = "No se encontr&oacute; un dao de CentroCostos correcto para el tipo:" + m_tipo;
                s_log.error ( error );
                throw new IllegalArgumentException ( error );
            }
        }

        return s_daoCentroCostos;
    }


}

